package com.mowwang.file;

import java.io.File;

public class Find {
    public static void main(String[] args) {
    File file=new File("d:/JAVAZ");
    ffind(file);
}
    public static void ffind(File file){
        File[] files=file.listFiles();
        for (File f:files) {
            if (f.isDirectory())
                ffind(f);
            else {
                String fileName = f.getName();
                if (fileName.lastIndexOf(".java") !=-1)
                    System.out.println(fileName);
//                if (fileName.endsWith(".java"))
////                    System.out.println(fileName);
            }

        }

    }

}
